/**
 	Validation class
 */
package nrb.validations
{
	import nrb.validations.validators.*;
	
	public class Validation {
		
		/**
		 	declare variables
		 */
		private var validation_flag:String = '';
		private var validation_error:String = '';
		
		/**
		 	Type: Controller
		 	@Params:flag['String'] AS String
		 	@return:none
		 	Desc: initializes variables
		 */
		public function Validation(){
			
		}
		
		public function set_validation_type(flag:String): void {
			validation_flag = flag;
		}
		
		/**
		 	Type: Public Function
		 	@Params:value['String'] AS String
		 	@return:Object
		 	Desc: validates
		 */
		public function validate(value:String, lang:String): Object {
			var obj:Object;
			if(validation_flag == 'EMAIL'){
				var email:EmailValidation = new EmailValidation();
				email.set_language(lang);
				obj = email.validate(value);
			}else if(validation_flag == 'ALPHANUMERIC'){
				var alpha:AlphanumericValidation = new AlphanumericValidation();
				alpha.set_language(lang);
				obj = alpha.validate(value);
			}else if(validation_flag == 'BLANK'){
				var blank:BlankValidation = new BlankValidation();
				blank.set_language(lang);
				obj = blank.validate(value);
			}
			return obj;	
		}
		
		
		
	}
}